home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / Ang261Lib.lha / src / tables.c < prev    next >
C/C++ Source or Header  |  1994-10-22  |  13KB  |  286 lines

  1. /* tables.c: store/attack/RNG/etc tables and variables
  2.  
  3.    Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
  4.  
  5.    This software may be copied and distributed for educational, research, and
  6.    not for profit purposes provided that this copyright and statement are
  7.    included in all such copies. */
  8.  
  9. #include "constant.h"
  10. #include "config.h"
  11. #include "types.h"
  12.  
  13. #if defined(CHECKHOURS)
  14. /* Operating hours for ANGBAND                -RAK-    */
  15. /*     X = Open; . = Closed                    */
  16. char days[7][29] = { "SUN:XXXXXXXXXXXXXXXXXXXXXXXX",
  17.             "MON:XXXXXXXX.........XXXXXXX",
  18.             "TUE:XXXXXXXX.........XXXXXXX",
  19.             "WED:XXXXXXXX.........XXXXXXX",
  20.             "THU:XXXXXXXX.........XXXXXXX",
  21.             "FRI:XXXXXXXX.........XXXXXXX",
  22.             "SAT:XXXXXXXXXXXXXXXXXXXXXXXX" };
  23. #endif
  24.  
  25. store_type store[MAX_STORES];
  26.  
  27. /* Store owners have different characteristics for pricing and haggling*/
  28. /* Note: Store owners should be added in groups, one for each store    */
  29. owner_type owners[MAX_OWNERS] = {
  30. {"Rincewind the Chicken  (Human)      General Store",
  31.       450,    175,  108,    4, 0, 12},
  32. {"Mauglin the Grumpy     (Dwarf)      Armoury"        ,
  33.     32000,    200,  112,    4, 5,  5},
  34. {"Arndal Beast-Slayer    (Half-Elf)   Weaponsmith"  ,
  35.     10000,    185,  110,    5, 1,  8},
  36. {"Ludwig the Humble      (Human)      Temple"        ,
  37.      5000,    175,  109,    6, 0, 15},
  38. {"Ga-nat the Greedy      (Gnome)      Alchemist"    ,
  39.     12000,    220,  115,    4, 4,  9},
  40. {"Luthien Starshine      (Elf)        Magic Shop"   ,
  41.     32000,    175,  110,    5, 2, 11},
  42. {"Durwin the Shifty      (Human)      Black Market" ,
  43.         32000,    250,  155,    10, 0, 5},
  44. {"Your home"   ,
  45.         1,    1,    1,    1, 1, 1},
  46. {"Bilbo the Friendly     (Hobbit)     General Store",
  47.       300,    170,  108,    5, 3, 15},
  48. {"Darg-Low the Grim      (Human)      Armoury"        ,
  49.     10000,    190,  111,    4, 0,  9},
  50. {"Oglign Dragon-Slayer   (Dwarf)      Weaponsmith"  ,
  51.     32000,    195,  112,    4, 5,  8},
  52. {"Gunnar the Paladin     (Human)      Temple"        ,
  53.     12000,    185,  110,    5, 0, 23},
  54. {"Mauser the Chemist     (Half-Elf)   Alchemist"    ,
  55.     10000,    190,  111,    5, 1,  8},
  56. {"Buggerby the Great!    (Gnome)      Magic Shop"   ,
  57.     20000,    215,  113,    6, 4, 10},
  58. {"Histor the Goblin      (Orc)        Black Market"   ,
  59.     32000,    250,  160,    10, 6, 5},
  60. {"Your sweet abode"   ,
  61.         1,    1,    1,    1, 1, 1},
  62. {"Lyar-el the Comely     (Elf)        General Store",
  63.       600,    165,  107,    6, 2, 18},
  64. {"Decado the Handsome    (Human)      Armoury",
  65.     25000,  200,  112,    4, 5, 10},
  66. {"Ithyl-Mak the Beastly  (Half-Troll) Weaponsmith"  ,
  67.      6000,    210,  115,    6, 7,  8},
  68. {"Delilah the Pure       (Half-Elf)   Temple"        ,
  69.     25000,    180,  107,    6, 1, 20},
  70. {"Wizzle the Chaotic     (Hobbit)     Alchemist"    ,
  71.     10000,    190,  110,    6, 3,  8},
  72. {"Inglorian the Mage     (Human?)     Magic Shop"   ,
  73.     32000,    200,  110,    7, 0, 10},
  74. {"Drago the Fair?        (Elf)        Black Market" ,
  75.     32000,    250,  150,    10, 2, 5},
  76. {"Your house"   ,
  77.         1,    1,    1,    1, 1, 1}
  78. };
  79.  
  80. /* Buying and selling adjustments for character race VS store    */
  81. /* owner race                             */
  82. int8u rgold_adj[MAX_RACES][MAX_RACES] = {
  83.             /*Hum, HfE, Elf,  Hal, Gno, Dwa, HfO, HfT, Dun, HiE*/
  84. /*Human         */     { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105},
  85. /*Half-Elf     */     { 110, 100, 100, 105, 110, 120, 125, 130, 110, 100},
  86. /*Elf         */     { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100},
  87. /*Halfling     */     { 115, 110, 105,  95, 105, 110, 115, 130, 115, 105},
  88. /*Gnome         */     { 115, 115, 110, 105,  95, 110, 115, 130, 115, 110},
  89. /*Dwarf         */     { 115, 120, 120, 110, 110,  95, 125, 135, 115, 120},
  90. /*Half-Orc     */     { 115, 120, 125, 115, 115, 130, 110, 115, 115, 125},
  91. /*Half-Troll     */     { 110, 115, 115, 110, 110, 130, 110, 110, 110, 115},
  92. /*Dunedain      */     { 100, 105, 105, 110, 113, 115, 120, 125, 100, 105},
  93. /*High_Elf     */     { 110, 105, 100, 105, 110, 120, 125, 130, 110, 100}
  94.             };
  95.  
  96. #define MDO MAX_DUNGEON_OBJ
  97.  
  98. /* object_list[] index of objects that may appear in the store */
  99. int16u store_choice[MAX_STORES][STORE_CHOICES] = {
  100.     /* General Store */
  101. {MDO,MDO,MDO,MDO,MDO,MDO,MDO,MDO,MDO+21,MDO+21,MDO+21,MDO+21,MDO+22,MDO+22,
  102.  MDO+22,MDO+1,MDO+2,MDO+3,MDO+4,
  103.  MDO+22,MDO+20,MDO+21,MDO+5,MDO+6,84,84,123,MDO+22,MDO+22,MDO+21},
  104.     /* Armoury     */
  105. {103,104,105,106,107,108,109,91,92,125,126,128,129,130,91,92,94,95,96,
  106.  103,104,105,125,128,94,95,111,112,113,121},
  107.     /* Weaponsmith     */
  108. {29,29,29,31,34,35,42,46,49,58,60,61,63,64,68,73,74,75,77,78,80,82,83,83,
  109.  78,80,82,35,65,66},
  110.     /* Temple     */
  111. {334,335,336,337,334,335,336,337,257,237,261,262,233,233,240,241,260,
  112.  260,MDO+14,MDO+15,MDO+15,MDO+15,53,54,55,52,335,180,237,240},
  113.     /* Alchemy shop     */
  114. {227,227,230,230,236,206,252,252,253,253,MDO+7,MDO+7,MDO+7,MDO+8,MDO+8,MDO+8,
  115.  MDO+9,MDO+10,MDO+11,MDO+12,MDO+13,MDO+15,MDO+15,173,174,175,185,185,185,206},
  116.     /* Magic-User store*/
  117. {330,331,332,333,330,331,332,333,326,293,293,299,303,301,302,318,326,
  118.  282,277,279,292,164,167,168,153,137,142,326,328,299}
  119. };
  120.  
  121. #ifndef MAC
  122. /* MPW doesn't seem to handle this very well, so replace store_buy array
  123.    with a function call on mac */
  124. /* functions defined in sets.c */
  125. extern int general_store(), armory(), weaponsmith(), temple(),
  126.   alchemist(), magic_shop();
  127.  
  128. int blackmarket();
  129. int home();
  130.  
  131. /* Each store will buy only certain items, based on TVAL */
  132. int (*store_buy[MAX_STORES])() = {
  133.        general_store, armory, weaponsmith, temple, alchemist, magic_shop,
  134.        blackmarket, home};
  135. #endif
  136.  
  137. /* Following are arrays for descriptive pieces            */
  138.  
  139. #ifdef MACGAME
  140.  
  141. const char **colors;
  142. const char **mushrooms;
  143. const char **woods;
  144. const char **metals;
  145. const char **rocks;
  146. const char **amulets;
  147. const char **syllables;
  148.  
  149. #else
  150.  
  151. const char *colors[MAX_COLORS] = {
  152. /* Do not move the first three */
  153.   "Icky Green", "Light Brown", "Clear",
  154.   "Azure","Blue","Blue Speckled","Black","Brown","Brown Speckled","Bubbling",
  155.   "Chartreuse","Cloudy","Copper Speckled","Crimson","Cyan","Dark Blue",
  156.   "Dark Green","Dark Red","Gold Speckled","Green","Green Speckled","Grey",
  157.   "Grey Speckled","Hazy","Indigo","Light Blue","Light Green","Magenta",
  158.   "Metallic Blue","Metallic Red","Metallic Green","Metallic Purple","Misty",
  159.   "Orange","Orange Speckled","Pink","Pink Speckled","Puce","Purple",
  160.   "Purple Speckled","Red","Red Speckled","Silver Speckled","Smoky",
  161.   "Tangerine","Violet","Vermilion","White","Yellow", "Purple Speckled",
  162.   "Pungent","Clotted Red","Viscous Pink","Oily Yellow","Gloopy Green",
  163.   "Shimmering","Coagulated Crimson"
  164. };
  165.  
  166. const char *mushrooms[MAX_MUSH] = {
  167.   "Blue","Black","Black Spotted","Brown","Dark Blue","Dark Green","Dark Red",
  168.   "Ecru","Furry","Green","Grey","Light Blue","Light Green","Plaid","Red",
  169.   "Slimy","Tan","White","White Spotted","Wooden","Wrinkled"/*,"Yellow",
  170.   "Shaggy","Red Spotted","Pale Blue","Dark Orange"*/
  171. };
  172.  
  173. const char *woods[MAX_WOODS] = {
  174.   "Aspen","Balsa","Banyan","Birch","Cedar","Cottonwood","Cypress","Dogwood",
  175.   "Elm","Eucalyptus","Hemlock","Hickory","Ironwood","Locust","Mahogany",
  176.   "Maple","Mulberry","Oak","Pine","Redwood","Rosewood","Spruce","Sycamore",
  177.   "Teak","Walnut",
  178.   "Mistletoe","Hawthorn","Bamboo","Silver","Runed","Golden","Ashen"/*,
  179.   "Gnarled","Ivory","Decorative","Willow"*/
  180. };
  181.  
  182. const char *metals[MAX_METALS] = {
  183.   "Aluminum","Cast Iron","Chromium","Copper","Gold","Iron","Magnesium",
  184.   "Molybdenum","Nickel","Rusty","Silver","Steel","Tin","Titanium","Tungsten",
  185.   "Zirconium","Zinc","Aluminum-Plated","Copper-Plated","Gold-Plated",
  186.   "Nickel-Plated","Silver-Plated","Steel-Plated","Tin-Plated","Zinc-Plated",
  187.   "Mithril-Plated","Mithril","Runed","Bronze","Brass","Platinum",
  188.   "Lead"/*,"Lead-Plated","Ivory","Pewter"*/
  189. };
  190.  
  191. const char *rocks[MAX_ROCKS] = {
  192.   "Alexandrite","Amethyst","Aquamarine","Azurite","Beryl","Bloodstone",
  193.   "Calcite","Carnelian","Corundum","Diamond","Emerald","Fluorite","Garnet",
  194.   "Granite","Jade","Jasper","Lapis Lazuli","Malachite","Marble","Moonstone",
  195.   "Onyx","Opal","Pearl","Quartz","Quartzite","Rhodonite","Ruby","Sapphire",
  196.   "Tiger Eye","Topaz","Turquoise","Zircon","Platinum","Bronze",
  197.   "Gold","Obsidian","Silver","Tortoise Shell","Mithril",
  198.   "Jet","Engagement","Adamantite"
  199. };
  200.  
  201. const char *amulets[MAX_AMULETS] = {
  202.   "Amber","Driftwood","Coral","Agate","Ivory","Obsidian",
  203.   "Bone","Brass","Bronze","Pewter","Tortoise Shell","Golden","Azure",
  204.   "Crystal","Silver","Copper"
  205. };
  206.  
  207. const char *syllables[MAX_SYLLABLES] = {
  208.   "a","ab","ag","aks","ala","an","ankh","app",
  209.   "arg","arze","ash","aus","ban","bar","bat","bek",
  210.   "bie","bin","bit","bjor","blu","bot","bu",
  211.   "byt","comp","con","cos","cre","dalf","dan",
  212.   "den","der","doe","dok","eep","el","eng","er","ere","erk",
  213.   "esh","evs","fa","fid","flit","for","fri","fu","gan",
  214.   "gar","glen","gop","gre","ha","he","hyd","i",
  215.   "ing","ion","ip","ish","it","ite","iv","jo",
  216.   "kho","kli","klis","la","lech","man","mar",
  217.   "me","mi","mic","mik","mon","mung","mur","nag","nej",
  218.   "nelg","nep","ner","nes","nis","nih","nin","o",
  219.   "od","ood","org","orn","ox","oxy","pay","pet",
  220.   "ple","plu","po","pot","prok","re","rea","rhov",
  221.   "ri","ro","rog","rok","rol","sa","san","sat",
  222.   "see","sef","seh","shu","ski","sna","sne","snik",
  223.   "sno","so","sol","sri","sta","sun","ta","tab",
  224.   "tem","ther","ti","tox","trol","tue","turs","u",
  225.   "ulk","um","un","uni","ur","val","viv","vly",
  226.   "vom","wah","wed","werg","wex","whon","wun","x",
  227.   "yerg","yp","zun","tri","blaa"
  228. };
  229. #endif
  230.  
  231. /* used to calculate the number of blows the player gets in combat */
  232. int8u blows_table[11][12] = {
  233. /* STR/W:       9  18  67  107  117  118  128  138  148  158  168 more : DEX */
  234. /* <2 */    {  1,  1,  1,   1,   1,   1,   2,   2,   2,   2,   2,   3},
  235. /* <3 */    {  1,  1,  1,   1,   2,   2,   3,   3,   3,   3,   3,   4},
  236. /* <4 */    {  1,  1,  1,   2,   2,   3,   4,   4,   4,   4,   4,   5},
  237. /* <6 */    {  1,  1,  2,   2,   3,   3,   4,   4,   4,   5,   5,   5},
  238. /* <8 */    {  1,  2,  2,   3,   3,   4,   4,   4,   5,   5,   5,   5},
  239. /* <10 */   {  1,  2,  2,   3,   4,   4,   4,   5,   5,   5,   5,   5},
  240. /* <13 */   {  2,  2,  3,   3,   4,   4,   5,   5,   5,   5,   5,   6},
  241. /* <15 */   {  2,  3,  3,   3,   4,   4,   5,   5,   5,   5,   5,   6},
  242. /* <18 */   {  3,  3,  3,   4,   4,   4,   5,   5,   5,   5,   6,   6},
  243. /* <20 */   {  3,  3,  3,   4,   4,   4,   5,   5,   5,   5,   6,   6},
  244. /* else */  {  3,  3,  4,   4,   4,   4,   5,   5,   5,   6,   6,   6}
  245.  
  246. };
  247.  
  248.  
  249. /* this table is used to generate a psuedo-normal distribution.     See the
  250.    function randnor() in misc1.c, this is much faster than calling
  251.    transcendental function to calculate a true normal distribution */
  252. int16u normal_table[NORMAL_TABLE_SIZE] = {
  253.      206,     613,    1022,    1430,    1838,     2245,      2652,       3058,
  254.     3463,    3867,    4271,    4673,    5075,     5475,      5874,       6271,
  255.     6667,    7061,    7454,    7845,    8234,     8621,      9006,       9389,
  256.     9770,   10148,   10524,   10898,   11269,    11638,     12004,      12367,
  257.    12727,   13085,   13440,   13792,   14140,    14486,     14828,      15168,
  258.    15504,   15836,   16166,   16492,   16814,    17133,     17449,      17761,
  259.    18069,   18374,   18675,   18972,   19266,    19556,     19842,      20124,
  260.    20403,   20678,   20949,   21216,   21479,    21738,     21994,      22245,
  261.    22493,   22737,   22977,   23213,   23446,    23674,     23899,      24120,
  262.    24336,   24550,   24759,   24965,   25166,    25365,     25559,      25750,
  263.    25937,   26120,   26300,   26476,   26649,    26818,     26983,      27146,
  264.    27304,   27460,   27612,   27760,   27906,    28048,     28187,      28323,
  265.    28455,   28585,   28711,   28835,   28955,    29073,     29188,      29299,
  266.    29409,   29515,   29619,   29720,   29818,    29914,     30007,      30098,
  267.    30186,   30272,   30356,   30437,   30516,    30593,     30668,      30740,
  268.    30810,   30879,   30945,   31010,   31072,    31133,     31192,      31249,
  269.    31304,   31358,   31410,   31460,   31509,    31556,     31601,      31646,
  270.    31688,   31730,   31770,   31808,   31846,    31882,     31917,      31950,
  271.    31983,   32014,   32044,   32074,   32102,    32129,     32155,      32180,
  272.    32205,   32228,   32251,   32273,   32294,    32314,     32333,      32352,
  273.    32370,   32387,   32404,   32420,   32435,    32450,     32464,      32477,
  274.    32490,   32503,   32515,   32526,   32537,    32548,     32558,      32568,
  275.    32577,   32586,   32595,   32603,   32611,    32618,     32625,      32632,
  276.    32639,   32645,   32651,   32657,   32662,    32667,     32672,      32677,
  277.    32682,   32686,   32690,   32694,   32698,    32702,     32705,      32708,
  278.    32711,   32714,   32717,   32720,   32722,    32725,     32727,      32729,
  279.    32731,   32733,   32735,   32737,   32739,    32740,     32742,      32743,
  280.    32745,   32746,   32747,   32748,   32749,    32750,     32751,      32752,
  281.    32753,   32754,   32755,   32756,   32757,    32757,     32758,      32758,
  282.    32759,   32760,   32760,   32761,   32761,    32761,     32762,      32762,
  283.    32763,   32763,   32763,   32764,   32764,    32764,     32764,      32765,
  284.    32765,   32765,   32765,   32766,   32766,    32766,     32766,      32766,
  285. };
  286.